<template>
	<div class="newdetail-contioner">
		<div class="mui-card">
			<div class="mui-card-header">
				{{newdetail.title}}
			</div>
			<div class="mui-card-content">
				<img :src="newdetail.imgUrl"/>
				<div class="mui-card-content-inner">
					<p>{{newdetail.author}} 发表 {{newdetail.dateTimes|dateFormat}}</p>
					<p style="color: #333;">{{newdetail.content}}</p>
				</div>
			</div>
			<div class="mui-card-footer">
				<comment-box :id="id"></comment-box>
			</div>
		</div>
	</div>
</template>

<script>
	import Comment from '../comment/Comment.vue';
	export default{
		data(){
			return {
				id:this.$route.params.id, //参数
				newdetail : {}
			}
		},
		created() {
			this.getNew();
		},
		methods:{
			getNew(){
				this.$http.get("/myvue/home/newslist/newdetail?id="+this.id).then(res=>{
					console.log(res.body);
					if(res.body){
						this.newdetail = res.body;
					}
				});
			}
		},
		components:{
			"comment-box":Comment
		}
	}
</script>

<style lang="less" scoped="scoped">
.mui-card-content{
	img{
		width: 100%;
		height: 200px;
	}
}

</style>
